package com.bjpowernode.controller;

import com.bjpowernode.entity.query.ActivityRemarkQuery;
import com.bjpowernode.common.result.Result;
import com.bjpowernode.service.ActiveRemarkService;
import com.bjpowernode.entity.vo.ActivityRemarkListVO;
import com.github.pagehelper.PageInfo;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;


@RestController
@RequiredArgsConstructor
public class ActiveRemarkController {

    private final ActiveRemarkService activeRemarkService;

    @PostMapping("/api/activity/remark")
    public Result activityRemark(@RequestBody ActivityRemarkQuery activityRemarkQuery) {
        int flag = activeRemarkService.activityRemark(activityRemarkQuery);
        return flag >= 1 ? Result.OK() : Result.FAIL();
    }


    @GetMapping("/api/activity/remark")
    public Result activityRemarks(@RequestParam(value = "current") Integer current,@RequestParam(value = "activityId") Integer activityId) {
        PageInfo<ActivityRemarkListVO> pageInfo = activeRemarkService.activityRemarks(current,activityId);
        return Result.OK(pageInfo);
    }


}
